﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meraz.Core.Model;

namespace Meraz.Core.Repositories
{
    public class TwitterLinkRepository : EFRepositoryBase<TwitterLink, long>, ITwitterLinkRepository
    {
        public override TwitterLink GetById(long id)
        {
            throw new NotImplementedException();
        }
        public TwitterLink GetById(long twitterID, int sequence)
        {
            return context.TwitterLinks
                .Where(where1 => where1.TweetID == twitterID && where1.Sequence == sequence)
                .FirstOrDefault();
        }

        public override void Add(TwitterLink entity)
        {
            context.AddToTwitterLinks(entity);
        }

        public override void Delete(TwitterLink entity)
        {
            context.TwitterLinks.DeleteObject(entity);
        }

        public override List<TwitterLink> All()
        {
            return context.TwitterLinks.ToList();
        }
    }
}
